import axios from '@/axios'

// 查询项目风险
export function getProjectRiskInfo(params) {
  return axios({
    url: '/task/tcProjectRisk/list',
    method: 'get',
    params,
  })
}

// 新增项目风险
export function addProjectRisk(data) {
  return axios({
    url: '/task/tcProjectRisk/add',
    method: 'post',
    data,
  })
}

// 编辑项目风险
export function editProjectRisk(data) {
  return axios({
    url: '/task/tcProjectRisk/edit',
    method: 'put',
    data,
  })
}

// 删除风险
export function delProjectRisk(riskId) {
  return axios({
    url: `/task/tcProjectRisk${riskId}`,
    method: 'delete',
  })
}

// 风险确认
export function enProjectRisk(riskId) {
  return axios({
    url: `/task/tcProjectRisk/riskConfirmation`,
    method: 'get',
    params: { riskId },
  })
}

// 查询风险处理措施
export function getProjectRiskSolution(riskId) {
  return axios({
    url: '/task/tcRiskSolution/list',
    method: 'get',
    params: { riskId },
  })
}

// 新增风险处理措施
export function addProjectRiskSolution(data) {
  return axios({
    url: '/task/tcRiskSolution',
    method: 'post',
    data,
  })
}

// 风险处理
export function riskTreatment(data) {
  return axios({
    url: '/task/tcProjectRisk/risktreatment',
    method: 'post',
    data,
  })
}

// 获取提出人和确认人
export function getTeamMember(projectId) {
  return axios({
    url: '/task/tcProjectRisk/getcreateBy',
    method: 'get',
    params: {
      projectId,
    },
  })
}

// 查询风险变更记录
export function getRiskHandlingRecord(riskId) {
  return axios({
    url: `/task/tcRiskHandlingRecord/list?riskId=${riskId}`,
    method: 'get',
  })
}
